/**
 * class pineapple.RealMachineModel
 *
 * March 28, 2012 
 * @authors Roman Kotusev, Darjuš Ilcevič, Kristis Vaškys
 */
package pineapple;


import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
 *
 * @author prly
 */
public class RealMachineModel extends javax.swing.JFrame {

    /**
     * Creates new form Test
     */
    public RealMachineModel() {
        initComponents();
        String iconPath = "src/pineapple/pine2.png";
        this.setIconImage(new ImageIcon(iconPath).getImage());
    }
    boolean executeButtonClick = false;
    boolean stepButtonClick = false;
    boolean executeAllButtonClick = false;
    boolean enterButtonClick = false;
    boolean closeButtonClick = false;

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        fileChooser = new javax.swing.JFileChooser();
        jScrollPane2 = new javax.swing.JScrollPane();
        textarea = new javax.swing.JTextArea();
        savePath = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        R1Label = new javax.swing.JLabel();
        R2Label = new javax.swing.JLabel();
        PDSLabel = new javax.swing.JLabel();
        PCSLabel = new javax.swing.JLabel();
        PSSLabel = new javax.swing.JLabel();
        rR1InputField = new javax.swing.JTextField();
        rR2InputField = new javax.swing.JTextField();
        rPDSInputField = new javax.swing.JTextField();
        rPCSInputField = new javax.swing.JTextField();
        rPSSInputField = new javax.swing.JTextField();
        IFLabel = new javax.swing.JLabel();
        CFLabel = new javax.swing.JLabel();
        DSLabel = new javax.swing.JLabel();
        CSLabel = new javax.swing.JLabel();
        SSLabel = new javax.swing.JLabel();
        rIFInputField = new javax.swing.JTextField();
        rCFInputField = new javax.swing.JTextField();
        rDSInputField = new javax.swing.JTextField();
        rCSInputField = new javax.swing.JTextField();
        rSSInputField = new javax.swing.JTextField();
        uploadFile = new javax.swing.JButton();
        UploadInput = new javax.swing.JTextField();
        closeButton = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        consoleField = new javax.swing.JTextArea();
        consoleInputField = new javax.swing.JTextField();
        executeAllButton = new javax.swing.JButton();
        executeStepButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        RAMTable = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        CSTable = new javax.swing.JTable();
        jScrollPane5 = new javax.swing.JScrollPane();
        DSTable = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        SSTable = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        enterButton = new javax.swing.JButton();
        executeButton = new javax.swing.JButton();
        filenameLabel = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        textarea.setColumns(20);
        textarea.setRows(5);
        jScrollPane2.setViewportView(textarea);

        savePath.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Pineapple v1.0");
        setBackground(new java.awt.Color(255, 255, 255));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Registrai", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Arial", 0, 10))); // NOI18N

        R1Label.setFont(new java.awt.Font("Arial", 0, 10));
        R1Label.setText("R1");
        R1Label.setName("R1Label"); // NOI18N

        R2Label.setFont(new java.awt.Font("Arial", 0, 10));
        R2Label.setText("R2");

        PDSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        PDSLabel.setText("PDS");

        PCSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        PCSLabel.setText("PCS");

        PSSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        PSSLabel.setText("PSS");

        rR1InputField.setEditable(false);
        rR1InputField.setText("0");
        rR1InputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rR2InputField.setEditable(false);
        rR2InputField.setText("0");
        rR2InputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rPDSInputField.setEditable(false);
        rPDSInputField.setText("0");
        rPDSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rPCSInputField.setEditable(false);
        rPCSInputField.setText("0");
        rPCSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rPSSInputField.setEditable(false);
        rPSSInputField.setText("0");
        rPSSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        IFLabel.setFont(new java.awt.Font("Arial", 0, 10));
        IFLabel.setText("IF");

        CFLabel.setFont(new java.awt.Font("Arial", 0, 10));
        CFLabel.setText("CF");

        DSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        DSLabel.setText("DS");

        CSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        CSLabel.setText("CS");

        SSLabel.setFont(new java.awt.Font("Arial", 0, 10));
        SSLabel.setText("SS");

        rIFInputField.setEditable(false);
        rIFInputField.setText("0");
        rIFInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rCFInputField.setEditable(false);
        rCFInputField.setText("0");
        rCFInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rDSInputField.setEditable(false);
        rDSInputField.setText("0");
        rDSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rCSInputField.setEditable(false);
        rCSInputField.setText("0");
        rCSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rSSInputField.setEditable(false);
        rSSInputField.setText("0");
        rSSInputField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(R2Label)
                        .addGap(18, 18, 18)
                        .addComponent(rR2InputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(R1Label)
                        .addGap(18, 18, 18)
                        .addComponent(rR1InputField, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(PSSLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rPSSInputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(PCSLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rPCSInputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(PDSLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rPDSInputField)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(SSLabel)
                        .addGap(18, 18, 18)
                        .addComponent(rSSInputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(CSLabel)
                        .addGap(18, 18, 18)
                        .addComponent(rCSInputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(DSLabel)
                        .addGap(18, 18, 18)
                        .addComponent(rDSInputField))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(CFLabel)
                            .addComponent(IFLabel))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(rIFInputField)
                            .addComponent(rCFInputField, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(39, 39, 39))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(R1Label)
                    .addComponent(rR1InputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(IFLabel)
                    .addComponent(rIFInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(R2Label)
                    .addComponent(rR2InputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CFLabel)
                    .addComponent(rCFInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(PDSLabel)
                    .addComponent(rPDSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(DSLabel)
                    .addComponent(rDSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(PCSLabel)
                    .addComponent(rPCSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CSLabel)
                    .addComponent(rCSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(PSSLabel)
                    .addComponent(rPSSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SSLabel)
                    .addComponent(rSSInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        uploadFile.setText("Isrinkti");
        uploadFile.setToolTipText("Isrinkti programa");
        uploadFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                uploadFileActionPerformed(evt);
            }
        });

        closeButton.setText("Uzdaryti programa");
        closeButton.setEnabled(false);
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });

        consoleField.setColumns(20);
        consoleField.setEditable(false);
        consoleField.setRows(5);
        jScrollPane3.setViewportView(consoleField);

        executeAllButton.setText("Vykdyti viska");
        executeAllButton.setEnabled(false);
        executeAllButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                executeAllButtonActionPerformed(evt);
            }
        });

        executeStepButton.setText("Vykdyti zingsni");
        executeStepButton.setEnabled(false);
        executeStepButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                executeStepButtonActionPerformed(evt);
            }
        });

        RAMTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "ID", "Number", "Word"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        RAMTable.setSelectionBackground(new java.awt.Color(255, 255, 153));
        RAMTable.setSelectionForeground(new java.awt.Color(0, 0, 102));
        jScrollPane1.setViewportView(RAMTable);
        RAMTable.getColumnModel().getColumn(0).setMinWidth(20);
        RAMTable.getColumnModel().getColumn(0).setPreferredWidth(20);

        jLabel1.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel1.setText("RAM");

        CSTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "ID", "Number", "Word"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        CSTable.setSelectionBackground(new java.awt.Color(255, 255, 153));
        CSTable.setSelectionForeground(new java.awt.Color(0, 0, 102));
        jScrollPane4.setViewportView(CSTable);
        CSTable.getColumnModel().getColumn(0).setMinWidth(20);
        CSTable.getColumnModel().getColumn(0).setPreferredWidth(20);

        DSTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "ID", "Number", "Word"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        DSTable.setSelectionBackground(new java.awt.Color(255, 255, 153));
        DSTable.setSelectionForeground(new java.awt.Color(0, 0, 102));
        jScrollPane5.setViewportView(DSTable);
        DSTable.getColumnModel().getColumn(0).setMinWidth(20);
        DSTable.getColumnModel().getColumn(0).setPreferredWidth(20);

        SSTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "ID", "Number", "Word"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        SSTable.setSelectionBackground(new java.awt.Color(255, 255, 153));
        SSTable.setSelectionForeground(new java.awt.Color(0, 0, 102));
        jScrollPane6.setViewportView(SSTable);
        SSTable.getColumnModel().getColumn(0).setMinWidth(20);
        SSTable.getColumnModel().getColumn(0).setPreferredWidth(20);

        jLabel2.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel2.setText("CS");

        jLabel3.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel3.setText("DS");

        jLabel4.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel4.setText("SS");

        enterButton.setText("Ivesti");
        enterButton.setEnabled(false);
        enterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterButtonActionPerformed(evt);
            }
        });

        executeButton.setText("Pakrauti");
        executeButton.setToolTipText("Pakrauti programa");
        executeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                executeButtonActionPerformed(evt);
            }
        });

        filenameLabel.setText("*.*");
        filenameLabel.setToolTipText("Current Filename");

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pineapple/logo.png"))); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(UploadInput, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(uploadFile)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(executeButton))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(consoleInputField, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(executeAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(closeButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(executeStepButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(enterButton))))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(filenameLabel)
                        .addGap(0, 472, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(filenameLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(consoleInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(enterButton))
                                .addGap(4, 4, 4))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(executeAllButton)
                                .addGap(6, 6, 6)
                                .addComponent(executeStepButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(closeButton))))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(UploadInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(executeButton)
                            .addComponent(uploadFile))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(11, 11, 11)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(101, 101, 101)
                                .addComponent(jLabel2)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel4)
                                .addGap(95, 95, 95))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(133, 133, 133)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(99, 99, 99)))))
                .addContainerGap())
        );

        jLabel5.getAccessibleContext().setAccessibleName("pineappleLogo");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void uploadFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadFileActionPerformed
        int returnVal = fileChooser.showOpenDialog(this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
            UploadInput.setText(file.getAbsolutePath()); // Gets file name
        } else {
            System.out.println("File access cancelled by user.");
        }
    }//GEN-LAST:event_uploadFileActionPerformed

    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
        closeButtonClick = true;
    }//GEN-LAST:event_closeButtonActionPerformed

    private void executeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_executeButtonActionPerformed
        executeButtonClick = true;
        uploadFile.setEnabled(false);
        executeButton.setEnabled(false);
    }//GEN-LAST:event_executeButtonActionPerformed

    private void executeStepButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_executeStepButtonActionPerformed
        stepButtonClick = true;
        uploadFile.setEnabled(false);
        executeButton.setEnabled(false);
    }//GEN-LAST:event_executeStepButtonActionPerformed

    private void executeAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_executeAllButtonActionPerformed
        executeAllButtonClick = true;
        stepButtonClick = true;
    }//GEN-LAST:event_executeAllButtonActionPerformed

    private void enterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterButtonActionPerformed
        enterButtonClick = true;
    }//GEN-LAST:event_enterButtonActionPerformed
    public void showAlertDialog(String msg){
        JOptionPane.showMessageDialog(this,
    msg,"ERROR",JOptionPane.ERROR_MESSAGE);
    }
    public String getAbsolutePath(){
        return UploadInput.getText();
    }
    public String getInput(){
        return consoleInputField.getText();
    }    
    public void enableEnterButton(){
        enterButton.setEnabled(true);
    }
    public void disableEnterButton(){
        enterButton.setEnabled(false);
    }
    public void enableExecuteAllButton(){
        executeAllButton.setEnabled(true);
    }
    public void disableExecuteAllButton(){
        executeAllButton.setEnabled(false);
    }
    public void enableExecuteStepButton(){
        executeStepButton.setEnabled(true);
    }
    public void disableExecuteStepButton(){
        executeStepButton.setEnabled(false);
    }
    public void enableCloseButton(){
        closeButton.setEnabled(true);
    }
    public void disableCloseButton(){
        closeButton.setEnabled(false);
    }
    
    public void updateGUI(Processor processor) {
        rSetR1(processor.getR1());
        rSetR2(processor.getR2());
        rSetPDS(processor.getPDS());
        rSetPCS(processor.getPCS());
        rSetPSS(processor.getPSS());
        rSetDS(processor.getDS());
        rSetCS(processor.getCS());
        rSetSS(processor.getSS());
        rSetIF(processor.getIF());
        rSetCF(processor.getCF());
        rSetRAMTable(processor);
        rSetCSTable(processor);
        rSetDSTable(processor);
        rSetSSTable(processor);

    }
    public void resetGUI (){
        rSetR1(0);
        rSetR2(0);
        rSetPDS(0);
        rSetPCS(0);
        rSetPSS(0);
        rSetDS(0);
        rSetCS(0);
        rSetSS(0);
        rSetIF(0);
        rSetCF(0);
        rResetRAMTable();
        rResetCSTable();
        rResetDSTable();
        rResetSSTable();
        CSTable.setRowSelectionInterval(0, 0);
        DSTable.setRowSelectionInterval(0, 0);
        SSTable.setRowSelectionInterval(0, 0);
        executeButtonClick = false;
        stepButtonClick = false;
        executeAllButtonClick = false;
        enterButtonClick = false;
        closeButtonClick = false;
        executeButton.setEnabled(true);
        uploadFile.setEnabled(true);
        executeAllButton.setEnabled(false);
        executeStepButton.setEnabled(false);
        closeButton.setEnabled(false);
        enterButton.setEnabled(false);
        consoleField.setText(null);
        consoleInputField.setText(null);
        filenameLabel.setText("*.*");
    }

    // Registru uzsettinimas
    public void rSetR1(Integer value) {
        rR1InputField.setText(value.toString());
    }

    public void rSetR2(Integer value) {
        rR2InputField.setText(value.toString());
    }

    public void rSetPDS(Integer value) {
        rPDSInputField.setText(value.toString());
    }

    public void rSetPCS(Integer value) {
        rPCSInputField.setText(value.toString());
    }

    public void rSetPSS(Integer value) {
        rPSSInputField.setText(value.toString());
    }

    public void rSetIF(Integer value) {
        rIFInputField.setText(value.toString());
    }

    public void rSetCF(Integer value) {
        rCFInputField.setText(value.toString());
    }

    public void rSetDS(Integer value) {
        rDSInputField.setText(value.toString());
    }

    public void rSetCS(Integer value) {
        rCSInputField.setText(value.toString());
    }

    public void rSetSS(Integer value) {
        rSSInputField.setText(value.toString());
    }

    public void rAddConsoleField(String line) {
        consoleField.append(line + "\n");
    }

    public void rSetRAMTable(Processor processor) {
        for (int i = 0; i < processor.memory.getSize(); i++) {
            RAMTable.setValueAt(i, i, 0);
            if (processor.memory.getNumber(i) != null) {
                RAMTable.setValueAt(processor.memory.getNumber(i), i, 1);
                RAMTable.setValueAt(processor.memory.getWord(i), i, 2);               
            }
        }
    }

   public void rSetCSTable(Processor processor) {
        for (int i = 0; i < 64; i++) {
            CSTable.setValueAt(i, i, 0);
            if (processor.memory.getNumber(i+processor.getPCS()) != null) {
                CSTable.setValueAt(processor.memory.getNumber(i+processor.getPCS()), i, 1);
                CSTable.setValueAt(processor.memory.getWord(i+processor.getPCS()), i, 2);
            } else {
                CSTable.setValueAt(null, i, 1);
                CSTable.setValueAt(null, i, 2);                
            }
            CSTable.setRowSelectionInterval(processor.getCS(), processor.getCS());
        }
    }
    public void rSetDSTable(Processor processor) {
        for (int i = 0; i < 64; i++) {
            DSTable.setValueAt(i, i, 0);
            if (processor.memory.getNumber(i+processor.getPDS()) != null) {
                DSTable.setValueAt(processor.memory.getNumber(i+processor.getPDS()), i, 1);
                DSTable.setValueAt(processor.memory.getWord(i+processor.getPDS()), i, 2);
            } else {
                DSTable.setValueAt(null, i, 1);
                DSTable.setValueAt(null, i, 2);                
            }
            DSTable.setRowSelectionInterval(processor.getDS(), processor.getDS());
        }
    }
     public void rSetSSTable(Processor processor) {
        for (int i = 0; i < 64; i++) {
            SSTable.setValueAt(i, i, 0);
            if (processor.memory.getNumber(i+processor.getPSS()) != null) {
                SSTable.setValueAt(processor.memory.getNumber(i+processor.getPSS()), i, 1);
                SSTable.setValueAt(processor.memory.getWord(i+processor.getPSS()), i, 2);
            } else {
                SSTable.setValueAt(null, i, 1);
                SSTable.setValueAt(null, i, 2);                
            }
            if(processor.getSS()!=64) SSTable.setRowSelectionInterval(processor.getSS(), processor.getSS());
        }
    }
     
     public void rResetRAMTable() {
        for (int i = 0; i < 768; i++) {
            RAMTable.setValueAt(null, i, 0);
            RAMTable.setValueAt(null, i, 1);
            RAMTable.setValueAt(null, i, 2);
        }
    }
    public void rResetCSTable() {
        for (int i = 0; i < 64; i++) {
            CSTable.setValueAt(null, i, 0);
            CSTable.setValueAt(null, i, 1);
            CSTable.setValueAt(null, i, 2);
        }
    }
    public void rResetDSTable() {
        for (int i = 0; i < 64; i++) {
            DSTable.setValueAt(null, i, 0);
            DSTable.setValueAt(null, i, 1);
            DSTable.setValueAt(null, i, 2);
        }
    }
    public void rResetSSTable() {
        for (int i = 0; i < 64; i++) {
            SSTable.setValueAt(null, i, 0);
            SSTable.setValueAt(null, i, 1);
            SSTable.setValueAt(null, i, 2);
        }
    }
    public void setFilenameLabel(String name){
        filenameLabel.setText(name);
    }
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel CFLabel;
    private javax.swing.JLabel CSLabel;
    private javax.swing.JTable CSTable;
    private javax.swing.JLabel DSLabel;
    private javax.swing.JTable DSTable;
    private javax.swing.JLabel IFLabel;
    private javax.swing.JLabel PCSLabel;
    private javax.swing.JLabel PDSLabel;
    private javax.swing.JLabel PSSLabel;
    private javax.swing.JLabel R1Label;
    private javax.swing.JLabel R2Label;
    private javax.swing.JTable RAMTable;
    private javax.swing.JLabel SSLabel;
    private javax.swing.JTable SSTable;
    private javax.swing.JTextField UploadInput;
    private javax.swing.JButton closeButton;
    private javax.swing.JTextArea consoleField;
    private javax.swing.JTextField consoleInputField;
    private javax.swing.JButton enterButton;
    private javax.swing.JButton executeAllButton;
    private javax.swing.JButton executeButton;
    private javax.swing.JButton executeStepButton;
    private javax.swing.JFileChooser fileChooser;
    private javax.swing.JLabel filenameLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTextField rCFInputField;
    private javax.swing.JTextField rCSInputField;
    private javax.swing.JTextField rDSInputField;
    private javax.swing.JTextField rIFInputField;
    private javax.swing.JTextField rPCSInputField;
    private javax.swing.JTextField rPDSInputField;
    private javax.swing.JTextField rPSSInputField;
    private javax.swing.JTextField rR1InputField;
    private javax.swing.JTextField rR2InputField;
    private javax.swing.JTextField rSSInputField;
    private javax.swing.JTextField savePath;
    private javax.swing.JTextArea textarea;
    private javax.swing.JButton uploadFile;
    // End of variables declaration//GEN-END:variables
}
